const canadianDollar = 0.91;

const Currency = function (canadianDollar) {
  this.canadianDollar = canadianDollar;
};

Currency.prototype.roundTwoDecimals = function (amount) {
  return Math.round(amount * 100) / 100;
};

Currency.prototype.canadianToUS = function (canandian) {
  return this.roundTwoDecimals(canandian * canadianDollar);
};

Currency.prototype.USToCanadian = function (us) {
  return this.roundTwoDecimals(us / canadianDollar);
};

module.exports = Currency;
